package com.steven.forum.utils

import com.alibaba.fastjson.JSONObject

object ResultUtils {
    const val SUCCESS_CODE = 0
    const val INSERT_ERROR = 1
    const val UPDATE_ERROR = 2
    const val SELECT_ERROR = 3
    const val DELETE_ERROR = 4
    fun makeResult(errorCode: Int, jsonObject: JSONObject?, msg: String = ""): JSONObject {
        val json = JSONObject()
        json["errorCode"] = errorCode
        json["result"] = jsonObject
        json["msg"] = msg
        return json
    }
}